package pl.edu.agh.io.sylvia.entity;

public class DBObject {
	//protected int id;
	protected Integer id;
	
	public DBObject(Integer id) {
		super();
		this.id = id;
	}
	
	public Integer getId(){
		return id;
	}
	
	protected void setId(Integer id){
		this.id = id;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj.getClass().getCanonicalName().equals((this.getClass().getCanonicalName()))) {
			return ((DBObject) obj).id.equals(id); 
		} else {
			return super.equals(obj);
		}
	}
	
	@Override
	public int hashCode() {
		return id.hashCode();
	}
}
